# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ErrorAnalysisAnnotation do
  @moduledoc """
  Model error analysis for each annotation.

  ## Attributes

  *   `attributedItems` (*type:* `list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ErrorAnalysisAnnotationAttributedItem.t)`, *default:* `nil`) - Attributed items for a given annotation, typically representing neighbors from the training sets constrained by the query type.
  *   `outlierScore` (*type:* `float()`, *default:* `nil`) - The outlier score of this annotated item. Usually defined as the min of all distances from attributed items.
  *   `outlierThreshold` (*type:* `float()`, *default:* `nil`) - The threshold used to determine if this annotation is an outlier or not.
  *   `queryType` (*type:* `String.t`, *default:* `nil`) - The query type used for finding the attributed items.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :attributedItems =>
            list(
              GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ErrorAnalysisAnnotationAttributedItem.t()
            )
            | nil,
          :outlierScore => float() | nil,
          :outlierThreshold => float() | nil,
          :queryType => String.t() | nil
        }

  field(:attributedItems,
    as:
      GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ErrorAnalysisAnnotationAttributedItem,
    type: :list
  )

  field(:outlierScore)
  field(:outlierThreshold)
  field(:queryType)
end

defimpl Poison.Decoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ErrorAnalysisAnnotation do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ErrorAnalysisAnnotation.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ErrorAnalysisAnnotation do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
